package com.ldn.server.manage;

import com.ldn.common.basic.utils.system.CronUtils;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.openfeign.EnableFeignClients;

/**
 * @author 李大牛家的牛 (scafel@163.com)
 * @product serverless
 * @className ManageApplication
 * @createDate 2025/1/13 - 14:54
 * @description ToDo...
 **/
@SpringBootApplication(scanBasePackages = {"com.ldn.server.manage", "com.ldn.server.boot3.starter", "com.ldn.database.dao"})
@EnableDiscoveryClient
@EnableFeignClients(basePackages = {"com.ldn.server.boot3.starter"})
@MapperScan("com.ldn.database.dao.mapper")
public class ManageApplication {

    public static void main(String[] args) {
        SpringApplication.run(ManageApplication.class, args);
        CronUtils.setMatchSecond(true);
        CronUtils.start();
        Runtime.getRuntime().addShutdownHook(new ExitHook());
    }
}


class ExitHook extends Thread {
    @Override
    public void run() {
        super.run();
        CronUtils.stop();
    }
}
